<template>
  <div class="header">
    <span @click="toggle">
      <Expand v-if="collapse"></Expand>
      <Fold v-else></Fold>
    </span>
    <el-divider></el-divider>
  </div>
</template>

<script lang="ts" setup>
const props = defineProps<{ collapse: boolean }>()
const emits = defineEmits(['update:collapse'])
const toggle = () => {
  // 修改父组件的数据
  emits('update:collapse', !props.collapse)
}
</script>

<style lang="scss" scoped>
.header {
  height: 60px;
  padding: 0 20px;
}
</style>
